<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <script type="text/javascript" src="/static/js/phprpc_client.js"></script>
    <script type="text/javascript">
var client = new PHPRPC_Client('http://127.0.0.1:7777/phprpc', ['pow', 'add', 'getmsg']);
function add()
{
  a = parseInt(document.getElementById("value_a").value);
  b = parseInt(document.getElementById("value_b").value);
  client.add(a, b, function (result, args, output, warning) {
      document.getElementById("result").innerHTML = result;
      if(result > 10000)
        return;
      document.getElementById("value_a").value = result;
      add();
      //alert(result);
  }, true);
}
function getmsg()
{
  client.getmsg(function (result, args, output, warning) {
      document.getElementById("msg").innerHTML += result+"<br />";
      getmsg();
  }, true);
}
function setmsg(msg)
{
  document.getElementById("haha").innerHTML += msg+"<br />";
}
    </script>
  </head>
  <body>
    <input type="text" id="value_a" name="value_a" value="2" size="4" /> +
    <input type="text" id="value_b" name="value_b" value="3" size="4" />
    <input type="button" onclick="add();" value="=" />
    <span name="result" id="result"></span>
    <br />
    <input type="button" onclick="getmsg();" value="获取消息" />
    <br />
    <span id="msg"></span>
    <br />
    <span id="haha"></span>
    <iframe src="/remoterpc/" style="display: none;"></iframe>
  </body>
</html>
